package org.itboys.weixin.entity;

import org.apache.commons.lang3.StringUtils;
import org.itboys.commons.utils.random.RandomUtils;
import org.mongodb.morphia.annotations.Entity;

/**
 * 微信自定义菜单 后台管理
 * @author 陈知奇
 *
 */
@Entity(value = "WeixinConfig", noClassnameStored = true)
public class WeixinConfig extends WeixinBaseEntity {
	
	private static final long serialVersionUID = -3559312845997461602L;
	
	public static final int TYPE_SERVICE=1;//服务号
	public static final int TYPE_SUBSCRIBE=0;//订阅号
	
	private String name; 				//微信公众账号名称
	private String email;				
	private String weixinId;			//微信公众账号原始ID
	private String  weixinNo;			//微信号
	private Integer type;				//账号类型 1:服务号 0:订阅号	
	private Integer pass=1;//是否认证通过 0:没有 1:认证通过 alter table weixin_config add column `pass`  tinyint(1) NOT null default 1 COMMENT '是否认证通过 0:没有 1:认证通过';
	private String 	logo;				//logo地址
	private String 	ewm;				//二维码图片地址  8cm alter table weixin_config add column `ewm1`  varchar(128) DEFAULT NULL;
	private String 	ewm1;				//二维码图片地址 12cm alter table weixin_config add column `ewm2`  varchar(128) DEFAULT NULL;
	private String 	ewm2;				//二维码图片地址 15cm alter table weixin_config add column `ewm3`  varchar(128) DEFAULT NULL;
	private String 	ewm3;				//二维码图片地址 30cm alter table weixin_config add column `ewm4`  varchar(128) DEFAULT NULL;
	private String 	ewm4;				//二维码图片地址 50cm alter table weixin_config add column `ewm5`  varchar(128) DEFAULT NULL;
	private String 	ewm5;				//二维码图片地址 冗余
	private String 	appId;				//微信appid
	private String  appSecret;			//app密钥\0\0
	private String partnerKey;  //微信支付密钥 alter table weixin_config add column `partner_key`  varchar(64) DEFAULT NULL;
	private String paySignKey;//微信支付签名 alter table weixin_config add column `pay_sign_key`  varchar(64) DEFAULT NULL;
	private String partnerId;//微信合作伙伴ID  alter table weixin_config add column `partner_id`  varchar(32) DEFAULT NULL;
	private String siteDomain;//微网站主域名 alter table weixin_config add column `site_domain`  varchar(32) DEFAULT NULL;
	private String reflectBean;  //微信支付密钥 alter table weixin_config add column `reflect_bean`  varchar(32) DEFAULT NULL;
	private String reflectMethod;//微网站主域名 alter table weixin_config add column `reflect_method`  varchar(32) DEFAULT NULL;
	private Long parentId;
	private String token;
	private String field1;
	private String field2;
	private String field3;
	private Long objId;
	private Long objId1;
	private String mchId;//商户号
	private String mcKkey;//商户的API密钥
	private String keyStore;//私钥存储路径

	private String accessToken;
	
	public String getMchId() {
		return mchId;
	}

	public void setMchId(String mchId) {
		this.mchId = mchId;
	}

	public String getMcKkey() {
		return mcKkey;
	}

	public void setMcKkey(String mcKkey) {
		this.mcKkey = mcKkey;
	}

	public String getKeyStore() {
		return keyStore;
	}

	public void setKeyStore(String keyStore) {
		this.keyStore = keyStore;
	}

	public Long get_parentId(){
		return this.parentId;
	}
	
	public String getToken() {
		return StringUtils.isBlank(token)? RandomUtils.getRandomStr(12):token;
	}


	public void setToken(String token) {
		this.token = token;
	}

	public Integer getPass() {
		return pass;
	}

	public void setPass(Integer pass) {
		this.pass = pass;
	}

	public Long getParentId() {
		return parentId;
	}
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getWeixinId() {
		return weixinId;
	}
	public void setWeixinId(String weixinId) {
		this.weixinId = weixinId;
	}
	public String getWeixinNo() {
		return weixinNo;
	}
	public void setWeixinNo(String weixinNo) {
		this.weixinNo = weixinNo;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public String getLogo() {
		return logo;
	}
	public void setLogo(String logo) {
		this.logo = logo;
	}
	public String getEwm() {
		return ewm;
	}
	public void setEwm(String ewm) {
		this.ewm = ewm;
	}
	public String getAppId() {
		return appId;
	}
	public void setAppId(String appId) {
		this.appId = appId;
	}
	public String getPartnerKey() {
		return partnerKey;
	}


	public void setPartnerKey(String partnerKey) {
		this.partnerKey = partnerKey;
	}


	public String getAppSecret() {
		return appSecret;
	}
	public void setAppSecret(String appSecret) {
		this.appSecret = appSecret;
	}


	public String getSiteDomain() {
		return siteDomain;
	}


	public void setSiteDomain(String siteDomain) {
		this.siteDomain = siteDomain;
	}


	public String getReflectBean() {
		return reflectBean;
	}


	public void setReflectBean(String reflectBean) {
		this.reflectBean = reflectBean;
	}


	public String getReflectMethod() {
		return reflectMethod;
	}


	public void setReflectMethod(String reflectMethod) {
		this.reflectMethod = reflectMethod;
	}


	public String getPaySignKey() {
		return paySignKey;
	}


	public void setPaySignKey(String paySignKey) {
		this.paySignKey = paySignKey;
	}


	public String getPartnerId() {
		return partnerId;
	}


	public void setPartnerId(String partnerId) {
		this.partnerId = partnerId;
	}


	public String getEwm1() {
		return ewm1;
	}


	public void setEwm1(String ewm1) {
		this.ewm1 = ewm1;
	}


	public String getEwm2() {
		return ewm2;
	}


	public void setEwm2(String ewm2) {
		this.ewm2 = ewm2;
	}


	public String getEwm3() {
		return ewm3;
	}


	public void setEwm3(String ewm3) {
		this.ewm3 = ewm3;
	}


	public String getEwm4() {
		return ewm4;
	}


	public void setEwm4(String ewm4) {
		this.ewm4 = ewm4;
	}


	public String getEwm5() {
		return ewm5;
	}


	public void setEwm5(String ewm5) {
		this.ewm5 = ewm5;
	}


	public String getField1() {
		return field1;
	}


	public void setField1(String field1) {
		this.field1 = field1;
	}


	public String getField2() {
		return field2;
	}


	public void setField2(String field2) {
		this.field2 = field2;
	}


	public String getField3() {
		return field3;
	}


	public void setField3(String field3) {
		this.field3 = field3;
	}


	public Long getObjId() {
		return objId;
	}


	public void setObjId(Long objId) {
		this.objId = objId;
	}


	public Long getObjId1() {
		return objId1;
	}


	public void setObjId1(Long objId1) {
		this.objId1 = objId1;
	}


	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}
}
